#region Copyright information
/* Copyright information
 * 
 * FileName:   	FormBase.cs
 * DateCreated: 03-31-2007
 * Author:     	Rader
 * Email:      	mailto:rader.net@gmail.com
 * Website:		http://raderdotnet.spaces.live.com
 
 * Copyright:	This file and the codes included are owned by Rader.
				You can use or distribute this file without removing the copyright information or modifying the cotent.
				The codes included can't be used with commecial purposes,unless you have got the perssion.
*/
#endregion

using System;
using System.Windows.Forms;

namespace RaderDotNet.ValidationAttributes
{
    [AttributeUsage(AttributeTargets.Field)]
    public class RequiredFieldAttribute:BaseCustomValidatorAttribute
    {   
        /// <summary>
        /// make sure the content of the target control is not empty
        /// </summary>
        public RequiredFieldAttribute()
            : base()
        {
        }

        protected override bool IsValid(object sender)
        {
            Control ctr = sender as Control;
            return ctr.Text != "";
        }
    }

}
